import { dictionarySchema } from '@/configs'

export default {
  created () {
    this.initDictionary()
  },
  methods: {
    async initDictionary () {
      if (dictionarySchema) {
        this.$utils.dictionary.init({ schema: dictionarySchema })
        const data = await this.$utils.dictionary.getReleaseTimeMap()
        const expiredKeys = await this.$request.post('/dic/compareReleaseTime', data || {})
        this.$utils.dictionary.removeKeys(expiredKeys)
      } else {
        this.$utils.dictionary.init()
      }
    }
  }
}
